//
//  CoctorClassModel.swift
//  FiveProvincesOfNorthChina
//
//  Created by kys-20 on 2019/9/20.
//  Copyright © 2019 kys-20. All rights reserved.
//

import Foundation
class DoctorClassModel {
    var url : String!
    var name : String!
    
    init(url:String,name:String) {
        self.url = url
        self.name = name
    }
    
    class func getVideoData(modelArray: @escaping(_ arr:[DoctorClassModel]?)->()){
        BmobTools.ComparisonOfTheQuery(nameOfTheTable: "video", columnName:"type", value: "video", success: { (array, count) in
            print(array)
            
            var classModel = [DoctorClassModel]()
            for i in 0...count-1{
               
                let obj = array[i] as! BmobObject
                let model = DoctorClassModel(url: obj.object(forKey: "url") as! String,
                                             name: obj.object(forKey: "name") as! String)
                classModel.append(model)
            }
            
           modelArray(classModel)
            
        }) { (error) in
            print(error)
        }
    }
    
}
